package com.clinic.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.PrimaryKeyJoinColumn;

@Entity
@PrimaryKeyJoinColumn(name = "me_obj_id")
public class Medicine extends Super_type {

	private static final long serialVersionUID = 1L;

	@Column(insertable = false, updatable = false)
	private int me_obj_id;
	@Column(length = 256)
	private String name;
	@Column(length = 256)
	private String publisher;
	@Column(length = 128)
	private String specialty;
	@Column(nullable = true)
	private boolean availability;

	public Medicine() {
		super();
	}

	public Medicine(String obj_owner_name, String name, String publisher,
			String specialty, boolean availability) {
		super(obj_owner_name);
		this.name = name;
		this.publisher = publisher;
		this.specialty = specialty;
		this.availability = availability;
	}

	public int getMe_obj_id() {
		return me_obj_id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPublisher() {
		return publisher;
	}

	public void setPublisher(String publisher) {
		this.publisher = publisher;
	}

	public String getSpecialty() {
		return specialty;
	}

	public void setSpeciality(String specialty) {
		this.specialty = specialty;
	}

	public boolean isAvailability() {
		return availability;
	}

	public void setAvailability(boolean availability) {
		this.availability = availability;
	}

	@Override
	public void _toString() {
		System.out.println("Enter - _toString");
		super._toString();
		System.out.println("name: " + this.name + "\npublisher: "
				+ this.publisher + "\nspeciality: " + this.specialty
				+ "\navailability: " + this.availability);
		System.out.println("Exit - _toString");
	}
}